<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Midterm_Lab6</title>
<link rel="stylesheet" type="text/css"
		href="view/public/css/bootstrap.css" />
		<link rel="stylesheet" type="text/css"
				href="view/public/css/bootstrap-responsive.css" />
				</head>

		
		<?php 
		class Major{
			private $majorName;
			private $Offset;
		
			public function __construct($majorName,$Offset){
				$this->majorName = $majorName;
				$this->Offset = $Offset;
			}
		
			public function getMajorName(){
				return $this->majorName;
			}
			public function getOffset(){
				return $this->Offset;
			}
		}
		
		class Offset{
			private $offsetName;
			private $Movie;
		
			public function __construct($offsetName,$Movie){
				$this->offsetName = $offsetName;
				$this->Movie = $Movie;
			}
		
			public function getOffsetName(){
				return $this->offsetName;
			}
			public function getMovie(){
				return $this->Movie;
			}
		}
		
		class Movie{
			private $movieName;
			private $Theater;
		
			public function __construct($movieName,$Theater){
				$this->movieName = $movieName;
				$this->Theater = $Theater;
			}
		
			public function getMovieName(){
				return $this->movieName;
			}
			public function getTheater(){
				return $this->Theater;
			}
		}
		
		class Theater{
			private $theaterID;
			private $Schedule;
		
			public function __construct($theaterID,$Schedule){
				$this->times = $theaterID;
				$this->seat = $Schedule;
			}
		
			public function getTheaterID(){
				return $this->theaterID;
			}
			public function getSchedule(){
				return $this->Schedule;
			}
		}
		
		class Schedule{
			private $time;
			private $date;
			private $Row;
		
			public function __construct($time,$date,$Row){
				$this->time = $time;
				$this->date = $date;
				$this->Row = $Row;
			}
		
			public function getTime(){
				return $this->time;
			}
			public function getDate(){
				return $this->date;
			}
			public function getRow(){
				return $this->Row;
			}
		}
		
		class Row{
			private $rowName;
			private $Seat;
		
			public function __construct($rowName,$Seat){
				$this->rowName = $rowName;
				$this->Seat = $Seat;
			}
		
			public function getRowName(){
				return $this->rowName;
			}
			public function getSeat(){
				return $this->Seat;
			}
		}
		
		class Seat{
			private $seatID;
			private $price;
		
			public function __construct($seatID,$price){
				$this->seatID = $seatID;
				$this->price = $price;
			}
		
			public function getSeatID(){
				return $this->seatID;
			}
			public function getPrice(){
				return $this->price;
			}
		}
		
		$seat[] = new Seat("1A", 170);
		$seat[] = new Seat("2A", 170);
		$seat[] = new Seat("3A", 170);
		$seat[] = new Seat("4A", 170);
		
		$row[] = new Row("A", $seat[0]);
		$row[] = new Row("B", $seat[1]);
		$row[] = new Row("C", $seat[2]);
		$row[] = new Row("D", $seat[3]);
		
		
		$schedule[] = new Schedule("11.00-13.00", "28/01/2556", $row[0]);
		$schedule[] = new Schedule("13.30-16.00", "28/01/2556", $row[1]);
		$schedule[] = new Schedule("16.30-18.00", "28/01/2556", $row[2]);
		$schedule[] = new Schedule("18.30-20.00", "28/01/2556", $row[3]);
		
		$theater[] = new Theater("1", $schedule[0]);
		$theater[] = new Theater("2", $schedule[1]);
		$theater[] = new Theater("3", $schedule[2]);
		$theater[] = new Theater("4", $schedule[3]);
		
		
		$movie[] = new Movie("สาระแน", $theater[0]);
		$movie[] = new Movie("yes or no 2", $theater[1]);
		$movie[] = new Movie("vampire twilight ", $theater[2]);
		$movie[] = new Movie("Harry Potter", $theater[3]);
		
		
		$offset[] = new Offset("Chiangmai", $movie[0]);
		$offset[] = new Offset("Chiangrai", $movie[1]);
		
		$major[] = new Major("Major Cineplex", $offset[0]);
	
		echo "เลือกรายการภาพยนต์ : <select name=\"landom1\">";
		for($i=0;$i<count($movie);$i++){
			echo "<option value=\"$i\">{$movie[$i]->getMovieName()}</option>";
		}
		echo "</select><br>";
		
		echo "เลือกสาขา : ";
		echo "<select name=\"landom2\">";
		for($j=0;$j<count($offset);$j++){
			echo "<option value=\"$j\">{$offset[$j]->getOffsetName() }</option>";
		}
		echo "</select><br>";
		
		echo "เลือกวัน :  ";
		echo "<select name=\"landom3\">";
		for($k=0;$k<count($schedule);$k++){
			echo "<option value=\"$k\">{$schedule[$k]->getDate() }</option>";
		}
		echo "</select><br>";
		
		echo "เลือกรอบฉาย :  ";
		echo "<select name=\"landom4\">";
		for($l=0;$l<count($schedule);$l++){
			echo "<option value=\"$l\">{$schedule[$l]->getTime() }</option>";
		}
		echo "</select><br>";
		
		echo "เลือกที่นั่ง : ";
		echo "<select name=\"landom5\">";
		for($m=0;$m<count($seat);$m++){
			echo "<option value=\"$m\">{$seat[$m]->getSeatID() }</option>";
		}
		echo "</select><br>";
		?>

		<input type="submit" value="OK"><br> <br>
	</form>

	
</div>
	
	</body>
	</html>